//**************************************************************************
//
//         (C) Okulov Rostislav, 2011

/*
 ***************************************************************************
 *                                                                         *
 *   This source is free software; you can redistribute it and/or modify   *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This code is distributed in the hope that it will be useful, but      *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 *   General Public License for more details.                              *
 *                                                                         *
 *   A copy of the GNU General Public License is available on the World    *
 *   Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also      *
 *   obtain it by writing to the Free Software Foundation,                 *
 *   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.        *
 *                                                                         *
 */
 
import javax.media.opengl.*;
import com.sun.opengl.util.GLUT;

public class tanks_base extends base3d{
    //tshoot shoot;
    //tdim dim;   
	float tank_speed;
    static GLUT glut = new GLUT();
    tshoot shoot = new tshoot();
    public void rotl(float tank_speed) {
        
        ang = ang - tank_speed;
        
    }
    public void rotr(float tank_speed) {
        
        ang = ang + tank_speed;
        
    }
    public void stpf(float tank_speed) {
        
        x += tank_speed*Math.sin(ang/180*Math.PI);
        z += tank_speed*Math.cos(ang/180*Math.PI);
    
    }
    public void stpb(float tank_speed) {
        
        x -= tank_speed*Math.sin(ang/180*Math.PI);
        z -= tank_speed*Math.cos(ang/180*Math.PI);
        
    }
    public void draw(GLAutoDrawable drawable) {
        GL gl = drawable.getGL();
        gl.glPushMatrix();
        gl.glColor3f(1.0f,1.0f,1.0f);
        gl.glTranslated(x, y, z);
        gl.glRotated(ang-90, 0, 1, 0);
        glut.glutSolidTeapot(0.05f);
        gl.glPopMatrix();
    }
}
